<template>
  <div>
    <Head :info="headInfo" @ListenToChildEvent="headHandle" />
    <div class="container">
      <Nuxt />
    </div>
  </div>
</template>

<script>
export default {
   transition: 'page',
  // or
  // transition: {
  //   name: 'page',
  //   mode: 'out-in',
  //   beforeEnter (el) {
  //     console.log('Before enter...');
  //   }
  // },
  data() {
    return {
      headInfo: "大家好",
    };
  },
  methods: {
    headHandle(mode, num) {
      if (mode) {
        this.headInfo = "大家不好" + num;
      } else {
        this.headInfo = "大家好" + num;
      }
    },
  },
  mounted() {
    this.$nextTick(() => {
      this.$nuxt.$loading.start()
      setTimeout(() => this.$nuxt.$loading.finish(), 2000)
    })
  }
};
</script>


<style>
</style>
